import request from '@/utils/request'
//获取当前会话历史
export function getDashscopeHistoryApi(params) {
  return request({
    url: `/ccAI/dashscope/history`,
    method: 'get',
    params: params
  })
}
//获取会话列表
export function getConversationListApi(params) {
  return request({
    url: `/ccAI/dashscope/conversationList`,
    method: 'get',
    params: params
  })
}
//新建会话
export function addConversationApi(data) {
  return request({
    url: `/ccAI/dashscope/conversation`,
    method: 'post',
    data: data
  })
}
//send  message
export function sendStreamMessageApi(data) {
  return request({
    url: `/ccAI/dashscope/stream`,
    method: 'post',
    data: data
  })
}
//删除对话
export function delStreamApi(params) {
  return request({
    url: `/ccAI/dashscope/conversation`,
    method: 'delete',
    params: params
  })
}
//获取课程助手列表
export function getCourseHelperListApi(params) {
  return request({
    url: `/ccAI/dashscope/courseHelperList`,
    method: 'get',
    params: params
  })
}
//会话重命名
export function saveConversationApi(data) {
  return request({
    url: `/ccAI/dashscope/conversation`,
    method: 'put',
    data: data
  })
}
//停止回答
export function stopStreamApi(conversationId) {
  return request({
    url: `/ccAI/dashscope/stopStream/${conversationId}`,
    method: 'post'
  })
}
// 上传并解析图片
export function uploadImageForConversationApi(conversationId,data) {
  return request({
    url: `/ccAI/dashscope/uploadImageForConversation/${conversationId}`,
    method: 'post',
    data:data
  })
}
//上传并解析文件
export function uploadFileForConversationApi(conversationId,data) {
  return request({
    url: `/ccAI/dashscope/uploadFileForConversation/${conversationId}`,
    method: 'post',
    data:data
  })
}
//删除解析文件
export function deleteFileForConversationApi(conversationId,fileId) {
  return request({
    url: `/ccAI/dashscope/deleteFileForConversation/${conversationId}/${fileId}`,
    method: 'delete',
  })
}
//AI出题
export function generateQuestionApi(data) {
  return request({
    url: `/ccAI/generateTopic/generateQuestion`,
    method: 'post',
    data:data
  })
}
//停止出题
export function stopGenerateQuestionApi(requestId) {
  return request({
    url: `/ccAI/generateTopic/stopGenerateQuestion/${requestId}`,
    method: 'post',
  })
}
//导入试题
export function importQuestionApi(data) {
  return request({
    url: `/ccAI/generateTopic/importQuestion`,
    method: 'post',
    data:data
  })
}
//课程助手列表排序
export function sortCourseHelperListApi(courseIds) {
  return request({
    url: `/ccAI/dashscope/courseHelperListSort/${courseIds}`,
    method: 'post'
  })
}
//会话列表排序
export function sortConversationListApi(data) {
  return request({
    url: `/ccAI/dashscope/conversationListSort`,
    method: 'post',
    data:data
  })
}
//刷新对话
export function refreshStreamApi(conversationId) {
  return request({
    url: `/ccAI/dashscope/refreshStream/${conversationId}`,
    method: 'post',
  })
}


